﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace RoadTeam.Enums
{
    public class GlobalConfig : ConfigurationSection
    {
        /// <summary>
        /// 获取配置信息
        /// </summary>
        private static ConfigSection section
        {
            get
            {
                return ConfigurationManager.GetSection("RoadTeam") as ConfigSection;
            }
        }

        /// <summary>
        /// 获取连接字符串
        /// </summary>
        public static String ConnectionString
        {
            get
            {
                return section.ConnectionString;
            }
        }

        /// <summary>
        /// 获取数据库类型
        /// </summary>
        public static String DataDbType
        {
            get
            {
                return section.DataDbType;
            }
        }

        /// <summary>
        /// 获取配置中的数据库版本
        /// </summary>
        public static String DbVersion
        {
            get
            {
                return section.DbVersion;
            }
        }


        /// <summary>
        /// 获取配置中存储文件的位置
        /// </summary>
        public static String FilePath
        {
            get
            {
                return section.FilePath;
            }
        }



        private static RoadTeamSystemConfigSection RtSection
        {
            get
            {
                return ConfigurationManager.GetSection("RoadTeamSystem") as RoadTeamSystemConfigSection;
            }
        }


        /// <summary>
        /// 对接系统的连接字符串
        /// </summary>
        public static string RtConnectionString
        {
            get
            {
                return RtSection.ConnectionString;
            }
        }

        /// <summary>
        /// 对接的乐天系统的数据库类型
        /// </summary>
        public static string RtDataDbType
        {
            get
            {
                return RtSection.DataDbType;
            }
        }

        /// <summary>
        /// 对接的乐天系统数据库版本
        /// </summary>
        public static string RtDbVersion
        {
            get
            {
                return RtSection.DbVersion;
            }
        }
        /// <summary>
        /// 对接的乐天系统类型
        /// BS或者CS
        /// </summary>
        public static string RtStemType
        {
            get
            {
                return RtSection.SystemType;
            }
        }

        

        /// <summary>
        /// 对接的乐天系统类型
        /// BS或者CS
        /// </summary>
        public static string RtSystemPath
        {
            get
            {
                return RtSection.SystemPath;
            }
        }


    }
}
